<?php
$returnArray = array( // 返回字段
    "memberid" => $_REQUEST["memberid"], // 商户ID
    "orderid" =>  $_REQUEST["orderid"], // 订单号
    "amount" =>  $_REQUEST["amount"], // 交易金额
    "datetime" =>  $_REQUEST["datetime"], // 交易时间
    "transaction_id" =>  $_REQUEST["transaction_id"], // 支付流水号
    "returncode" => $_REQUEST["returncode"],
);
$md5key = "12b1vbnucanl95cibzd4yhlaeg28rgh6";
ksort($returnArray);
reset($returnArray);
$md5str = "";
foreach ($returnArray as $key => $val) {
    $md5str = $md5str . $key . "=" . $val . "&";
}
$sign = strtoupper(md5($md5str . "key=" . $md5key));
if ($sign == $_REQUEST["sign"]) {
    if ($_REQUEST["returncode"] == "00") {
        $str = "交易成功！订单号：".$_REQUEST["orderid"];
        file_put_contents("success.txt",$str."\n", FILE_APPEND);
        exit("ok");
    }
}
?>